from django.db import models
from django.contrib.sites.models import Site

#lass Storage(models.Model):
#hostname = models.CharField(max_length=128)
#ip = models.CharField(max_length=10)
#class Admin:
#	pass
#	list_display = ('hostname', 'ip')

#class Domain(models.Model):
#        name = models.CharField(max_length=256)
#        class Admin:
#                pass
#                list_display = ('name',)
#		search_fields = ['name']

#	def __unicode__(self):
#		return self.name


class Rule(models.Model):
	path = models.CharField(max_length=256)
	#target = models.CharField(max_length=256, core=True)
	site = models.ForeignKey(Site)
#	domain = models.ForeignKey(Domain)
#	active = models.BooleanField()
	#, edit_inline=models.STACKED, num_in_admin=3)

	class Admin:
		pass
		list_display = ('path', 'site')
		list_filter = ('site',)
#		search_fields = ['foreign_key__domain_name']

class Target(models.Model):
	value = models.CharField(max_length=256, core=True)
	rule = models.ForeignKey(Rule, edit_inline=models.STACKED, num_in_admin=3)
#	class Admin:
#		pass		





